import Vue from 'vue'
import App from './App.vue'
import Vuex from 'vuex'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import VueRouter from "vue-router";
import router from "./router";
import store from './store'
import 'animate.css';
import cookie from 'vue-cookie'
import '@/assets/icons'

//一定要插在Vue.use(VueRouter)之前
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
Vue.config.productionTip = false
Vue.prototype.$cookie = cookie;
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter);
Vue.use(Vuex);
Vue.use(ElementUI);

new Vue({
  render: h => h(App),
  store,
  beforeCreate(){
    Vue.prototype.$bus = this
  },
  router:router
}).$mount('#app')
